<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    //  function fn1() {
    //         return new Promise((resolve, reject) => {
    //             setInterval(() => {
    //                 msg = '你等我一下我 3s';
    //                 resolve(msg)
    //             }, 3000);
    //         })
    //     }

    //     async function passpro() {
    //         let res = await fn1();
    //         alert(res)
    //     }

    //     passpro();
    let num = null;
    setTimeout(function fn() {
      setTimeout(function () {
        console.log(1);
        num++;
        if (num == 5) {
          return num;
        }
        fn();
      }, 1000);
    });
  </script>
</html>
